package eclipse_sync_plugin;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

public class IconGenerator {
    public static void main(String[] args) {
        try {
            // 创建16x16的图像
            BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2d = image.createGraphics();
            
            // 设置背景为透明
            g2d.setColor(new Color(0, 0, 0, 0));
            g2d.fillRect(0, 0, 16, 16);
            
            // 绘制一个简单的图标（蓝色圆形）
            g2d.setColor(new Color(0, 120, 215));
            g2d.fillOval(2, 2, 12, 12);
            
            // 绘制白色边框
            g2d.setColor(Color.WHITE);
            g2d.drawOval(2, 2, 12, 12);
            
            g2d.dispose();
            
            // 确保icons目录存在
            File iconsDir = new File("icons");
            if (!iconsDir.exists()) {
                iconsDir.mkdir();
            }
            
            // 保存为GIF
            File output = new File("icons/sample.gif");
            ImageIO.write(image, "gif", output);
            
            System.out.println("图标已生成: " + output.getAbsolutePath());
            
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} 